<template>
  <div class="block-status-wrap" :style="{ height: height }">
    <div class="block-nodata" v-if="currentStatus === 1">
      <img src="../../assets/images/no_sub.png" />
      <div class="text fs-28 no-wrap lh-48 mt-16 text-sub">{{ textTip }}</div>
    </div>
    <div class="block-nodata" v-else>
      <i class="icon-data"></i>
      <div class="text fs-28 no-wrap lh-48 mt-16 text-sub">{{ textTip }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'BlockStatus',
  data() {
    return {
      isCircle: true,
    };
  },
  props: {
    textTip: {
      default: '暂无数据',
      type: String,
    },
    // 当前状态 失败：0; 加载：1
    currentStatus: {
      default: 0,
      type: Number,
    },
    height: {
      default: '100vh',
      type: String,
    },
  },
};
</script>

<style lang="less" scoped>
.block-nodata {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.table-loading {
  position: relative;
  width: 100%;
  height: 100%;
  .load-wrap {
    border-color: none;
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    background-color: transparent;
    text-align: center;
  }

  .load {
    border-color: none;
    width: 3rem;
    height: 0.8rem;
    text-align: center;
  }

  .load > div {
    .theme-mixins(background-color, #eee, #222);
    height: 100%;
    width: 0.06rem;
    display: inline-block;
    margin: 0 0.07rem;
    -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
    animation: stretchdelay 1.2s infinite ease-in-out;
  }

  .load > div:nth-child(2) {
    -webkit-animation-delay: -1.1s;
    animation-delay: -1.1s;
  }

  .load > div:nth-child(3) {
    -webkit-animation-delay: -1s;
    animation-delay: -1s;
  }

  .load > div:nth-child(4) {
    -webkit-animation-delay: -0.9s;
    animation-delay: -0.9s;
  }

  .load > div:nth-child(5) {
    -webkit-animation-delay: -0.8s;
    animation-delay: -0.8s;
  }

  @-webkit-keyframes stretchdelay {
    0%,
    40%,
    100% {
      -webkit-transform: scaleY(0.4);
    }
    20% {
      -webkit-transform: scaleY(1);
    }
  }

  @keyframes stretchdelay {
    0%,
    40%,
    100% {
      transform: scaleY(0.4);
      -webkit-transform: scaleY(0.4);
    }
    20% {
      transform: scaleY(1);
      -webkit-transform: scaleY(1);
    }
  }

  .black-mode & {
    background-color: #252528;

    .load {
      background-color: #252528;

      & > div {
        background-color: #a9a9a9;
      }
    }
  }

  .black-mode.android & {
    background-color: #1e1e1e;

    .load {
      background-color: #1e1e1e;
    }
  }
}
</style>
